$ psql -h localhost -p 5433 -U laetitia test
psql (15devel)
Type "help" for help.
test=# \conninfo
You are connected to database "test" as user "laetitia"
on host "localhost" (address "::1") at port "5433".
$ psql postgresql://laetitia@localhost:5433/test
psql (15devel)
Type "help" for help.
test=# \conninfo
You are connected to database "test" as user "laetitia"
on host "localhost" (address "::1") at port "5433".
$ psql "postgresql://laetitia@localhost:5433/test?\
application_name=Laetitia_laptop_psql"
laetitia=# select
application_name from pg_stat_activity where usename='laetitia';
application_name
----------------------
Laetitia_laptop_psql
(1 row)
$ psql "user=laetitia host=localhost port=5433 dbname=test"
psql (15devel)
Type "help" for help.
test=# \conninfo
You are connected to database "test" as user "laetitia"
on host "localhost" (address "::1") at port "5433".
$ psql "user=laetitia host=localhost port=5433 dbname=test
application_name=Laetitia_laptop_psql"
laetitia=# select
application_name from pg_stat_activity where usename='laetitia';
application_name
----------------------
Laetitia_laptop_psql
(1 row)
$ cat ~/.pg_service.conf
[mydb]
host=localhost
port=5433
user=test
dbname=laetitia
psql service=mydb
psql (15devel)
Type "help" for help.
laetitia=> \conninfo
You are connected to database "laetitia" as user "test"
on host "localhost" (address "::1") at port "5433".
clusterdb, createdb, dropdb, pg_restore, reindexdb, vacuumdb
createuser, dropuser, pgbench
-d
(or
--dbname
)clusterdb, pg_basebackup, pg_dump, pg_dumpall, pg_isready, pg_receivewal, pg_recvlogical, pg_restore, psql, reindexdb, vacuumdb
--maintenance-db
createdb, dropdb, reindexdb, vacuumdb
clusterdb, psql
-d
for
something elsepgbench, createuser
-d is the debug flag for pgbench
-d is the database creation permission floag for createuser
Document the behaviour everywhere
➕ easy to do
➖ does not solve the inconsistency
Remove useless client applications
clusterdb, createdb, createuser, dropdb, dropuser, reindexdb, vacuumdb
➕ easy to do
➕ sinplifies things
➖ does not solve all the inconsistencies
➖ breaks backward compatibility
Make sure all the tools can use -d
➕ solves all the inconsistencies
➖ does not solve the documentation problem
➖ breaks backward compatibility for pgbench and createuser
Remove all clients and create a new one to rule them all
➕ solves all the inconsistencies
➕ solves the documentation problem
➖ breaks backward compatibility for all client tools
Combination of Solutions 1, 2, 3 and 4
➕ solves all the inconsistencies
➕ solves the documentation problem
➖ does only simplify things a little...
➖ breaks backward compatibility for pgbench
create database ...
drop database ...
create role ...
drop role ...
reindex database ...
psql
\gexec
-d
--debug
for debugpg export
to replace pg_dump
pg import
to replace pg_restore
pg connect
to replace psql